package com.ruoyi.quartz.task;

import com.ruoyi.quartz.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("ryTask")
public class RyTask {

    private static final Logger logger = LoggerFactory.getLogger(RyTask.class);

    @Autowired
    private ISysJobService jobService;

    @Autowired
    private ISysDingTaskService sysDingTaskService;

    @Autowired
    private ICrmService crmService;

    @Autowired
    private IYongyouService yongyouService;

    @Autowired
    private IDataCleanService dataCleanService;

    @Autowired
    private IDataCleanWeeklyService weeklyService;

    @Autowired
    private IYongyouXshtService xshtService;

    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params) {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams() {
        System.out.println("执行无参方法");
    }

    //  导入各片区批注数据
    public void impAraeCustomers() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date startDate = new Date();
        String formattedDate = sdf.format(startDate);
        System.out.println("导入各片区批注数据-->开始:"+formattedDate);
        xshtService.impAraeCustomers();
        Date endDate = new Date();
        String formattedDate1 = sdf.format(endDate);
        long diff = (endDate.getTime() - startDate.getTime()) / 1000;
        System.out.println("清洗时间为 "+diff+" 秒");
        System.out.println("导入各片区批注数据-->结束:"+formattedDate1);
    }

    //  导入各片区批注数据
    public void statAraeCustomers() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date startDate = new Date();
        String formattedDate = sdf.format(startDate);
        System.out.println("统计各片区批注数据-->开始:"+formattedDate);
        xshtService.statAraeCustomers();
        Date endDate = new Date();
        String formattedDate1 = sdf.format(endDate);
        long diff = (endDate.getTime() - startDate.getTime()) / 1000;
        System.out.println("清洗时间为 "+diff+" 秒");
        System.out.println("统计各片区批注数据-->结束:"+formattedDate1);
    }

//---------------------------------------------数据清洗-----------------------------------------------------------------
    //---------------------------周会看板------------------------------------------------------
    public void weeklyYsDataClean() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date startDate = new Date();
        String formattedDate = sdf.format(startDate);
        System.out.println("数据清洗-周会看板营收【每天时同步】-->开始:"+formattedDate);
        // 洋桔梗
//        weeklyService.ysDataClean();
//        weeklyService.lyDataClean();
        Date endDate = new Date();
        String formattedDate1 = sdf.format(endDate);
        long diff = (endDate.getTime() - startDate.getTime()) / 1000;
        System.out.println("清洗时间为 "+diff+" 秒");
        System.out.println("数据清洗-周会看板营收【每天时同步】-->结束:"+formattedDate1);
    }
    //---------------------------采购部数据清洗-------------------------------------------------
    public void cgDataClean(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date startDate = new Date();
        String formattedDate = sdf.format(startDate);
        System.out.println("数据清洗-采购部【每小时同步】-->开始:"+formattedDate);
        // 洋桔梗
        dataCleanService.cgDataClean();
        // 种球
        dataCleanService.cgZQDataClean();
        Date endDate = new Date();
        String formattedDate1 = sdf.format(endDate);
        long diff = (endDate.getTime() - startDate.getTime()) / 1000;
        System.out.println("清洗时间为 "+diff+" 秒");
        System.out.println("数据清洗-采购部【每小时同步】-->结束:"+formattedDate1);
    }

//---------------------------------------------用友 数据同步-----------------------------------------------------------------
    //---------------------------日常增量-------------------------------------------------
    public void yyWldaDaily(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-物料档案【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyWlda();
        System.out.println("共更新物料档案数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-物料档案【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyCgddDaily(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购订单【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgddDaily();
        System.out.println("共更新采购订单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购订单【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyCgfpDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购发票【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgfpDaily();
        System.out.println("共更新采购发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购发票【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyCgrkDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购入库【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgrkDaily();
        System.out.println("共更新采购发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购入库【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyClck() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-材料出库【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyClck();
        System.out.println("共更新材料出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-材料出库【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyCprkDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-产品入库【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCprkDaily();
        System.out.println("共更新产品入库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-产品入库【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyQtckDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-其他出库【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyQtckDaily();
        System.out.println("共更新其他出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-其他出库【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyXsckDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售出库【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXsckDaily();
        System.out.println("共更新销售出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售出库【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyXsfpDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售发票【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXsfpDaily();
        System.out.println("共更新销售发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售发票【每小时同步】-->结束:"+formattedDate1);
    }

    public void yyXshtDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售合同【每小时同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXshtDaily();
        System.out.println("共更新销售合同数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售合同【每小时同步】-->结束:"+formattedDate1);
    }

    //---------------------------全量同步-------------------------------------------------
    public void yyXsht() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售合同【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXsht();
        System.out.println("共更新销售合同数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售合同【全量同步】-->结束:"+formattedDate1);
    }

    public void yyXsfp() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售发票【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXsfp();
        System.out.println("共更新销售发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售发票【全量同步】-->结束:"+formattedDate1);
    }

    public void yyXsck() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-销售出库【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyXsck();
        System.out.println("共更新销售出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-销售出库【全量同步】-->结束:"+formattedDate1);
    }

    public void yyQtck() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-其他出库【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyQtck();
        System.out.println("共更新其他出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-其他出库【全量同步】-->结束:"+formattedDate1);
    }

    public void yyCprk() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-产品入库【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCprk();
        System.out.println("共更新产品入库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-产品入库【全量同步】-->结束:"+formattedDate1);
    }

    public void yyClckDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-材料出库【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyClckDaily();
        System.out.println("共更新材料出库数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-材料出库【全量同步】-->结束:"+formattedDate1);
    }

    public void yyCgrk() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购入库【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgrk();
        System.out.println("共更新采购发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购入库【全量同步】-->结束:"+formattedDate1);
    }

    public void yyCgfp() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购发票【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgfp();
        System.out.println("共更新采购发票数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购发票【全量同步】-->结束:"+formattedDate1);
    }

    public void yyCgdd() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-采购订单【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyCgdd();
        System.out.println("共更新采购订单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-采购订单【全量同步】-->结束:"+formattedDate1);
    }

    public void yyWlda() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("用友-物料档案【全量同步】-->开始:"+formattedDate);
        int count = yongyouService.yyWlda();
        System.out.println("共更新物料档案数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("用友-物料档案【全量同步】-->结束:"+formattedDate1);
    }


//---------------------------------------------CRM 数据同步-----------------------------------------------------------------

    //--------------------------------------------一天同步一次 最近一周的数据----------------------------------------------------
    public void crmYgxxDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-员工信息【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmYgxxDaily();
        System.out.println("共更新员工数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-员工信息【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    public void crmKhglDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-客户管理【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmKhglDaily();
        System.out.println("共更新客户管理数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-客户管理【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    public void crmKhggcDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-客户公共池【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmKhggcDaily();
        System.out.println("共更新客户公共池数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-客户公共池【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    public void crmCpxxDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-产品信息【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmCpxxDaily();
        System.out.println("共更新产品信息数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-产品信息【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    public void crmHtddDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-合同订单【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmHtddDaily();
        System.out.println("共更新合同订单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-合同订单【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    public void crmFhdDaily() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM-发货单【同步最近一周,每天凌晨跑】-->开始:"+formattedDate);
        int count = crmService.crmFhdDaily();
        System.out.println("共更新发货单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM-发货单【同步最近一周,每天凌晨跑】-->结束:"+formattedDate1);
    }

    //--------------------------------------------半个小时拉一次----------------------------------------------------
    public void crmYgxxHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM员工信息[半小时]-->开始:"+formattedDate);
        int count = crmService.crmYgxxHourly();
        System.out.println("共更新员工数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM员工信息[半小时]-->结束:"+formattedDate1);
    }

    public void crmKhglHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM客户管理[半小时]-->开始:"+formattedDate);
        int count = crmService.crmKhglHourly();
        System.out.println("共更新客户管理数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM客户管理[半小时]-->结束:"+formattedDate1);
    }

    public void crmKhggcHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM客户公共池[半小时]-->开始:"+formattedDate);
        int count = crmService.crmKhggcHourly();
        System.out.println("共更新客户公共池数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM客户公共池[半小时]-->结束:"+formattedDate1);
    }

    public void crmCpxxHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM产品信息[半小时]-->开始:"+formattedDate);
        int count = crmService.crmCpxxHourly();
        System.out.println("共更新产品信息数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM产品信息[半小时]-->结束:"+formattedDate1);
    }

    public void crmHtddHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM合同订单[半小时]-->开始:"+formattedDate);
        int count = crmService.crmHtddHourly();
        System.out.println("共更新合同订单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM合同订单[半小时]-->结束:"+formattedDate1);
    }

    public void crmFhdHourly() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM发货单[半小时]-->开始:"+formattedDate);
        int count = crmService.crmFhdHourly();
        System.out.println("共更新发货单数据 "+count+" 条");
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM返货单[半小时]-->结束:"+formattedDate1);
    }


    //--------------------------------------------下面是全量同步----------------------------------------------------

    /**
     * CRM员工信息
     */
    public void crmYgxx() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM员工信息-->开始:"+formattedDate);
        crmService.getYgxxData();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM员工信息-->结束:"+formattedDate1);
    }
    /**
     * CRM客户管理
     */
    public void crmKhgl() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM客户管理-->开始:"+formattedDate);
        crmService.crmKhgl();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM客户管理-->结束:"+formattedDate1);
    }

    /**
     * CRM客户公共池
     */
    public void crmKhggc() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM客户公共池-->开始:"+formattedDate);
        crmService.crmKhggc();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM客户公共池-->结束:"+formattedDate1);
    }
    /**
     * CRM产品信息
     */
    public void crmCpxx(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM产品信息-->开始:"+formattedDate);
        crmService.crmCpxx();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM产品信息-->结束:"+formattedDate1);
    }

    /**
     * CRM发货单
     */
    public void crmFhd(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM发货单-->开始:"+formattedDate);
        crmService.crmFhd();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM发货单-->结束:"+formattedDate1);
    }

    /**
     * CRM合同订单
     */
    public void crmHtdd(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("CRM合同订单-->开始:"+formattedDate);
        crmService.crmHtdd();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("CRM合同订单-->结束:"+formattedDate1);
    }

//---------------------------------------------钉钉 组织架构-----------------------------------------------------------------
    /**
     * 钉钉-公司组织架构
     */
    public void orgMembers() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String formattedDate = now.format(formatter);
        System.out.println("拉取公司的所有员工-->开始:"+formattedDate);
        sysDingTaskService.getMembersData();
        LocalDateTime now1 = LocalDateTime.now();
        String formattedDate1 = now1.format(formatter);
        System.out.println("拉取公司的所有员工-->结束:"+formattedDate1);
    }
}
